home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1995 February: Tool Chest / Dev.CD Feb 95 / Dev.CD Feb 95.toast / Sample Code / Snippets / Development Tools & Languages / AEGestalt 1.0 / AEGestalt.r < prev    next >
Encoding:
Text File  |  1992-07-15  |  11.4 KB  |  465 lines  |  [TEXT/MPS ]

  1. //     Copyright © 1991 by Apple Computer, Inc.  All rights reserved. 
  2. //     AEGestalt.r file.
  3. //    Kent Sandvik DTS
  4. //    This file contains all the normal MacApp resources, with
  5. //    the exception of the window/view resources which are in the
  6. //    views.rsrc file (in 3.0 'View' format). The "2.0 views.rsrc"
  7. //    file contains the same information in the old format.
  8. //
  9. //    <1>        khs        1.0        First final version
  10.  
  11.  
  12. // INCLUDES 
  13.  
  14. #ifndef __TYPES.R__
  15. #include "Types.r"
  16. #endif
  17.  
  18. #ifndef __SYSTYPES.R__
  19. #include "SysTypes.r"                // needed for version resource
  20. #endif        
  21.  
  22. #ifndef __MacAppTypes__
  23. #include "MacAppTypes.r"
  24. #endif
  25.  
  26. #if qTemplateViews
  27. #ifndef __ViewTypes__
  28. #include "ViewTypes.r"
  29. #endif
  30. #endif
  31.  
  32. #if qDebug
  33. include "Debug.rsrc";
  34. #endif
  35.  
  36. #ifndef __RESOURCECONSTANTS__
  37. #include "ResourceConstants.h"            // common header file for resource IDs
  38. #endif
  39.  
  40.  
  41. // RESOURCES FILES
  42.  
  43. include "MacApp.rsrc";
  44. include "views.rsrc";
  45.  
  46.  
  47. // CODE 
  48.  
  49. include $$Shell("ObjApp")"AEGestalt" 'CODE';
  50.  
  51.  
  52. // CONSTANTS
  53.  
  54. // Finder Information
  55.  
  56. #define kApplicationName                $$Shell("XAppName")
  57.  
  58.  
  59. // SIZE
  60.  
  61. resource 'SIZE' (-1) {
  62.     saveScreen,
  63.     acceptSuspendResumeEvents,
  64.     enableOptionSwitch,
  65.     canBackground,
  66.     doesActivateOnFGSwitch,
  67.     backgroundAndForeground,
  68.     dontGetFrontClicks,
  69.     ignoreAppDiedEvents,
  70.     is32BitCompatible,
  71.     isHighLevelEventAware,
  72.     localAndRemoteHLEvents,
  73.     isStationeryAware,                
  74.     reserved,
  75.     reserved,
  76.     reserved,
  77.     reserved,
  78. #if qModelFarCode
  79.     575 * 1024,
  80.     550 * 1024,
  81. #elif qDebug
  82.     850 * 1024,
  83.     850 * 1024
  84. #else
  85.     500 * 1024,
  86.     500 * 1024
  87. #endif
  88. };
  89.  
  90.  
  91. // APPLEEVENTS 
  92.  
  93. resource 'aedt' (kGestaltAEEvents) {        // AE Dispatch table resource
  94.     {
  95.     kMacAppClass, kAEGetConfig, cAEProvideGestaltInfo;
  96.     }
  97. };
  98. //    AE Class, AE Message ID, command Number
  99.  
  100. // SEG!
  101.  
  102. resource 'seg!' (256, purgeable) {
  103.     {
  104.         "GNonRes";
  105.         "GSelCommand";
  106.         "GTerminate";
  107.         "GClose";
  108.         "GDoCommand";
  109.     }
  110. };
  111.  
  112.  
  113. // VERS
  114.  
  115. // Version for MouseInfo
  116.  
  117. RESOURCE 'vers' (1,
  118. #if qNames
  119.     "Application Version",
  120. #endif
  121.     purgeable) {
  122.     0x01,
  123.     0x00,
  124.     final,
  125.     0x01,
  126.     verUs,
  127.     "1.0",
  128.     "1.0, Application created by MacApp® and Mountain Dew®"
  129. };
  130.  
  131. include "Defaults.rsrc"  'vers' (2);                // overall package
  132.  
  133.  
  134.  
  135. // ALERTS AND DLOGS 
  136.  
  137. include "Defaults.rsrc" 'ALRT'    (phAboutApp);        // About… window
  138. include "Defaults.rsrc" 'DITL'    (phAboutApp);        // About… contents
  139. include "Defaults.rsrc" 'STR#'    (kDefaultCredits);    // credits
  140.  
  141.  
  142. // ICONs and BUNDLE
  143. // Get the default MacApp® application icon and file reference
  144.  
  145. include "Defaults.rsrc"  'ICN#' (128);
  146.  
  147.  
  148. // CMNUs 
  149.  
  150. include "Defaults.rsrc" 'CMNU' (mApple);            // grab the default Apple/File menus
  151.  
  152. resource 'CMNU' (mFile,
  153. #if qNames
  154. "mFile",
  155. #endif
  156. nonpurgeable) {
  157.     mFile,
  158.     textMenuProc,
  159.     EnablingManagedByMacApp,
  160.     enabled,
  161.     "File",
  162.     {
  163.     "New",                noIcon, "N",    noMark, plain, cNew;
  164.     "Close",            noIcon, "W",    noMark, plain, cClose;
  165.     "-",                noIcon, noKey,    noMark, plain, nocommand;
  166.     "Quit",                noIcon, "Q",    noMark, plain, cQuit
  167.     }
  168. };
  169.  
  170. resource 'CMNU' (mExamine,
  171. #if qNames
  172. "mExamine",
  173. #endif
  174. nonpurgeable) {
  175.     mExamine,
  176.     textMenuProc,
  177.     allEnabled,
  178.     enabled,
  179.     "Examine",
  180.     {
  181.     "Find…",            noIcon, "F",    noMark, plain, cFindAEGestalt;
  182.     "Report…",            noIcon, "R",    noMark, plain, cCreateReport
  183.     }
  184. };
  185.  
  186.  
  187. // MBARs 
  188. // Displayed menus 
  189.  
  190. resource 'MBAR' (kMBarDisplayed,
  191. #if qNames
  192. "Windoid",
  193. #endif
  194.     purgeable) {
  195.     {mApple; mFile; mExamine}
  196. };
  197.  
  198.  
  199. //--------------------------------------------------------------------------------------------------
  200. //     Icons, Bundles and FRefs… Oh my! (don't forget the Signature)
  201. //    It is very important that the Signature is registered here, because
  202. //    we are using it as a way to register the application PPC port, and 
  203. //    otherwise we will get a default name, which will not show up in the
  204. //    PPCBrowse filtering function. I learned this hard lesson 3.23 am
  205. //    and it was even a Saturday morning, sigh!
  206.  
  207. type kSignature as 'STR ';
  208. resource kSignature (0,
  209. #if qNames
  210. "Signature",
  211. #endif
  212.     purgeable) {
  213.     "AEGestalt 3.0b2 ©Apple Computer, Inc. 1991"
  214. };
  215.  
  216. resource 'FREF' (kApplicationID,
  217. #if qNames
  218. "AEGestalt Application",
  219. #endif
  220.     purgeable) {
  221.     'APPL',
  222.     0,
  223.     ""
  224. };
  225.  
  226. resource 'FREF' (kDocumentID,
  227. #if qNames
  228. "AEGestalt Document",
  229. #endif
  230.     purgeable) {
  231.     kFileType,
  232.     1,
  233.     ""
  234. };
  235.  
  236. resource 'FREF' (kStationeryID,
  237. #if qNames
  238. "AEGestalt Stationery",
  239. #endif
  240.     purgeable) {
  241.     kStationery,
  242.     2,
  243.     ""
  244. };
  245.  
  246. resource 'BNDL' (kBundleID,
  247. #if qNames
  248. "AEGestalt",
  249. #endif
  250.     purgeable) {
  251.     kSignature,
  252.     0,
  253.     { /* array TypeArray: 2 elements */
  254.         /* [1] */
  255.         'ICN#',
  256.         { /* array IDArray: 3 elements */
  257.             0, kApplicationID,
  258.             1, kDocumentID,
  259.             2, kStationeryID
  260.         },
  261.         /* [2] */
  262.         'FREF',
  263.         { /* array IDArray: 3 elements */
  264.             0, kApplicationID,
  265.             1, kDocumentID,
  266.             2, kStationeryID
  267.         }
  268.     }
  269. };
  270.  
  271.  
  272.  
  273. // About Dialog resources + Views #################################################################################################################
  274. // a couple of the resources are actually unused, but I left them in because I might need them
  275. // in another project :-)
  276.  
  277.  
  278. include "PICT.rsrc";                    // PICT resource (1002)
  279.  
  280. resource 'STR#' (10006, "Window titles", purgeable) {
  281.     {    /* array StringArray: 1 elements */
  282.         /* [1] */
  283.         "About MouseInfo"
  284.     }
  285. };
  286.  
  287. resource 'STR#' (10005, "Static Text text", purgeable) {
  288.     {    /* array StringArray: 4 elements */
  289.         /* [1] */
  290.         "AEGestalt Sample App",
  291.         /* [2] */
  292.         "Information",
  293.         /* [3] */
  294.         "Version Info",
  295.         /* [4] */
  296.         "AEGestalt is a MacApp 3.0 AppleEvent snippet - create and handle AEs (see Release Notes for info!).\nKent Sandvik/DTS (ALink: KSAND, Net: ksand@apple.com)",
  297.         /* [5] */
  298.         " ",
  299.         /* [6] */
  300.         "Kent & Jeff Sandvik hacking on the next Apple OS"
  301.     }
  302. };
  303.  
  304. resource 'TxSt' (10000, purgeable) {
  305.     tsBold,
  306.     36,
  307.     {    /* array: 3 elements */
  308.         /* [1] */
  309.         0x0,
  310.         /* [2] */
  311.         0x0,
  312.         /* [3] */
  313.         0x0
  314.     },
  315.     "Times"
  316. };
  317.  
  318. resource 'TxSt' (10001, purgeable) {
  319.     tsPlain,
  320.     0,
  321.     {    /* array: 3 elements */
  322.         /* [1] */
  323.         0x0,
  324.         /* [2] */
  325.         0x0,
  326.         /* [3] */
  327.         0x0
  328.     },
  329.     "Chicago"
  330. };
  331.  
  332. resource 'TxSt' (10002, purgeable) {
  333.     tsBold,
  334.     9,
  335.     {    /* array: 3 elements */
  336.         /* [1] */
  337.         0x0,
  338.         /* [2] */
  339.         0x0,
  340.         /* [3] */
  341.         0x0
  342.     },
  343.     "Monaco"
  344. };
  345.  
  346. resource 'TxSt' (10003, purgeable) {
  347.     tsBold,
  348.     9,
  349.     {    /* array: 3 elements */
  350.         /* [1] */
  351.         0xFFFF,
  352.         /* [2] */
  353.         0xFFFF,
  354.         /* [3] */
  355.         0xFFFF
  356.     },
  357.     "Monaco"
  358. };
  359.  
  360. resource 'TxSt' (10004, purgeable) {
  361.     tsBold,
  362.     36,
  363.     {    /* array: 3 elements */
  364.         /* [1] */
  365.         0xE604,
  366.         /* [2] */
  367.         0xFFFF,
  368.         /* [3] */
  369.         0x591C
  370.     },
  371.     "Times"
  372. };
  373.  
  374.  
  375.  
  376.  
  377. resource 'View' (12000, "About Box Window") {MAThreeOh, 
  378.     {
  379.     ViewSignatureAndClassname
  380.         {'wind', 909, "", 'ATBW', enabled, noIdle, {}, MAThreeOh, 
  381.         {45, 45}, {263, 435}, sizeFixed, sizeFixed, notShown, doesntWantToBeTarget, 
  382.         handlesCursor, letsSubViewsHandleCursor, noCursorID, 
  383.         handlesHelp, letsSubViewsHandleHelp, noHelpID, 1, 
  384.         NoDrawingEnvironment {}, 
  385.         AdornerListSignatureAndClassname {NoIdentifier, AdornerList, AdornerElementSize, AdornerElementSizeShift, DynamicArrayAllocationIncrement, {
  386.             AdornFirst, AdornerLocalObject {EraseAdorner}, 
  387.             DrawView, AdornerLocalObject {DrawAdorner}}}, emptyUserArea, 
  388.         Window {noGrowDocProc, noID, goAwayBox, notResizable, doFirstClick, 
  389.             freeOnClosing, disposeOnFree, doesntCloseDocument, dontOpenWithDocument, dontAdaptToScreen, dontStagger, forceOnScreen, 
  390.             center, doesntFloat, doesntHideOnSuspend, generateActivates, filler, 10006, 1}, 7}, 
  391.     ViewSignatureAndClassname
  392.         {'stat', 96, "", 'stat', notEnabled, noIdle, {}, MAThreeOh, 
  393.         {10, 25}, {39, 397}, sizeVariable, sizeVariable, shown, doesntWantToBeTarget, 
  394.         handlesCursor, letsSubViewsHandleCursor, noCursorID, 
  395.         handlesHelp, letsSubViewsHandleHelp, noHelpID, 1, 
  396.         NoDrawingEnvironment {}, 
  397.         NoAdorners {}, emptyUserArea, 
  398.         StaticText {mStaticTextHit, notHilited, notDimmed, sizeable, noInset, 10004, dontPreferOutline, autoWrap, dontEraseFirst, justSystem, 10005, 1}, 
  399.         NoSubviews}, 
  400.     ViewSignatureAndClassname
  401.         {'pict', 156, "TPicture", 'pict', notEnabled, noIdle, {}, MAThreeOh, 
  402.         {50, 8}, {195, 265}, sizeVariable, sizeVariable, shown, doesntWantToBeTarget, 
  403.         handlesCursor, letsSubViewsHandleCursor, noCursorID, 
  404.         handlesHelp, letsSubViewsHandleHelp, noHelpID, 1, 
  405.         NoDrawingEnvironment {}, 
  406.         AdornerListSignatureAndClassname {NoIdentifier, AdornerList, AdornerElementSize, AdornerElementSizeShift, DynamicArrayAllocationIncrement, {
  407.             DrawView, AdornerLocalObject {DrawAdorner}, 
  408.             AdornAfter, AdornerSignatureAndClassname {'comp', "", 'comp', freeOnDeletion, $"0F"}}}, emptyUserArea, 
  409.         Picture {mPictureHit, notHilited, notDimmed, sizeable, noInset, 10001, dontPreferOutline, 1002}, 
  410.         NoSubviews}, 
  411.     ViewSignatureAndClassname
  412.         {'stat', 154, "", 'info', notEnabled, noIdle, {}, MAThreeOh, 
  413.         {50, 287}, {16, 122}, sizeVariable, sizeVariable, shown, doesntWantToBeTarget, 
  414.         handlesCursor, letsSubViewsHandleCursor, noCursorID, 
  415.         handlesHelp, letsSubViewsHandleHelp, noHelpID, 1, 
  416.         NoDrawingEnvironment {}, 
  417.         AdornerListSignatureAndClassname {NoIdentifier, AdornerList, AdornerElementSize, AdornerElementSizeShift, DynamicArrayAllocationIncrement, {
  418.             AdornFirst, AdornerLocalObject {EraseAdorner},
  419.             DrawView, AdornerLocalObject {DrawAdorner}, 
  420.             AdornAfter, AdornerSignatureAndClassname {'comp', "", 'comp', freeOnDeletion, $"8F"}}}, emptyUserArea, 
  421.         StaticText {mStaticTextHit, notHilited, notDimmed, sizeable, noInset, 10002, dontPreferOutline, autoWrap, dontEraseFirst, justSystem, 10005, 2}, 
  422.         NoSubviews}, 
  423.     ViewSignatureAndClassname
  424.         {'stat', 154, "", 'vers', notEnabled, noIdle, {}, MAThreeOh, 
  425.         {200, 287}, {16, 122}, sizeVariable, sizeVariable, shown, doesntWantToBeTarget, 
  426.         handlesCursor, letsSubViewsHandleCursor, noCursorID, 
  427.         handlesHelp, letsSubViewsHandleHelp, noHelpID, 1, 
  428.         NoDrawingEnvironment {}, 
  429.         AdornerListSignatureAndClassname {NoIdentifier, AdornerList, AdornerElementSize, AdornerElementSizeShift, DynamicArrayAllocationIncrement, {
  430.         AdornFirst, AdornerLocalObject {EraseAdorner},
  431.         DrawView, AdornerLocalObject {DrawAdorner}, 
  432.             AdornAfter, AdornerSignatureAndClassname {'comp', "", 'comp', freeOnDeletion, $"8F"}}}, emptyUserArea, 
  433.         StaticText {mStaticTextHit, notHilited, notDimmed, sizeable, noInset, 10002, dontPreferOutline, autoWrap, dontEraseFirst, justSystem, 10005, 3}, 
  434.         NoSubviews}, 
  435.     ViewSignatureAndClassname
  436.         {'stat', 96, "", 'sta1', notEnabled, noIdle, {}, MAThreeOh, 
  437.         {70, 287}, {130, 144}, sizeVariable, sizeVariable, shown, doesntWantToBeTarget, 
  438.         handlesCursor, letsSubViewsHandleCursor, noCursorID, 
  439.         handlesHelp, letsSubViewsHandleHelp, noHelpID, 1, 
  440.         NoDrawingEnvironment {}, 
  441.         NoAdorners {}, emptyUserArea, 
  442.         StaticText {mStaticTextHit, notHilited, notDimmed, sizeable, noInset, 10003, dontPreferOutline, autoWrap, dontEraseFirst, justSystem, 10005, 4}, 
  443.         NoSubviews}, 
  444.     ViewSignatureAndClassname
  445.         {'stat', 96, "", 'sta2', notEnabled, noIdle, {}, MAThreeOh, 
  446.         {225, 287}, {36, 144}, sizeVariable, sizeVariable, shown, doesntWantToBeTarget, 
  447.         handlesCursor, letsSubViewsHandleCursor, noCursorID, 
  448.         handlesHelp, letsSubViewsHandleHelp, noHelpID, 1, 
  449.         NoDrawingEnvironment {}, 
  450.         NoAdorners {}, emptyUserArea, 
  451.         StaticText {mStaticTextHit, notHilited, notDimmed, sizeable, noInset, 10003, dontPreferOutline, autoWrap, dontEraseFirst, justSystem, 10005, 5}, 
  452.         NoSubviews},
  453.     ViewSignatureAndClassname
  454.         {'stat', 96, "", 'sta3', notEnabled, noIdle, {}, MAThreeOh, 
  455.         {248, 8}, {16, 360}, sizeVariable, sizeVariable, shown, doesntWantToBeTarget, 
  456.         handlesCursor, letsSubViewsHandleCursor, noCursorID, 
  457.         handlesHelp, letsSubViewsHandleHelp, noHelpID, 1, 
  458.         NoDrawingEnvironment {}, 
  459.         NoAdorners {}, emptyUserArea, 
  460.         StaticText {mStaticTextHit, notHilited, notDimmed, sizeable, noInset, 10003, dontPreferOutline, autoWrap, dontEraseFirst, justSystem, 10005, 6}, 
  461.         NoSubviews}, 
  462.     }
  463. };
  464.  
  465.